/***************************************************************************
                          sqlite3stmt.h  -  description
                             -------------------
    begin                : Sat May 10 2008
    copyright            : (C) 2008 by Samuel Harrington
    email                : robotsam@gmail.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef SQLITE3STMT_H
#define SQLITE3STMT_H

#include <qglobal.h>

#include "sqlite3.h"

/**Iterator wrapper for sqlite3_stmt.
  *@author Samuel Harrington
  */

class sqlite3Stmt {
public: 
	sqlite3Stmt( sqlite3 *s, const char *t, int ts=-1, const char **tail=0 );
	~sqlite3Stmt();
  
  /** Go to next row. */
  int step();
  /** There are no more rows to get. */
  bool done() const;
  /** Retreive column i as text from the current row. */
  const char* column_text(int i) const;
  /** Retreive column i as an integer from the current row. */
  int column_int(int i) const;

public: // Public attributes
  sqlite3_stmt *stmt;
  /** The database pointer */
  sqlite3 *sql;
  /** The last return value from */
  int last_ret;
};

#endif
